﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Big2.CardsLib;

namespace Big2.Big2Game
{
    [Serializable]
    public class Player
    {
        private string _Name;
        private static int _ID = 0;
        private int _Score;
        private int _PreviousScore;
        private Hand _Hand;
        private bool _WonLastHand;

        //default constructor
        public Player()
        {
            _ID = ++_ID;
            _Name = "Player" + _ID.ToString() ;
            _Score = 0;
            _Hand = new Hand();
            _WonLastHand = false;
            _PreviousScore = 0;
        }//default constructor

        //1 parameter constructor passing name
        public Player(string name)
        {
            _Name = name;
            _ID = ++_ID;
            _Score = 0;
            _Hand = new Hand();
            _WonLastHand = false;
            _PreviousScore = 0;
        }//1 parameter constructor passing name

        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }//get and set Name

        public int Score
        {
            get { return _Score; }
            set { _Score = value; }
        }//get and set Score

        public int ID
        {
            get { return _ID; }
        }//read only ID property

        public Hand Hand
        {
            get { return _Hand; }
            set { _Hand = value; }
        }//get and set Hand

        public bool WonLast
        {
            get { return _WonLastHand; }
            set { _WonLastHand = value; }
        }//get and set wonlasthand

        public int PreviousScore
        {
            get { return _PreviousScore; }
            set { _PreviousScore = value; }
        }//get and set Score


        public void ResetHand()
        {
            Hand = new Hand();
        }

    }
}
